package com.molichuxing.gateway.bff.permission.services;

import com.molichuxing.framework.dto.Paged;
import com.molichuxing.framework.result.ResponseResult;
import com.molichuxing.gateway.bff.permission.entity.request.GroupBindVo;
import com.molichuxing.gateway.bff.permission.entity.request.GroupCreateVo;
import com.molichuxing.gateway.bff.permission.entity.request.GroupModifyVo;
import com.molichuxing.gateway.bff.permission.entity.response.GroupBindResourceVo;
import com.molichuxing.gateway.bff.permission.entity.response.GroupVo;

import java.util.List;
import java.util.Map;

public interface GroupBffService {

    /**
     * 根据查询条件，查询角色列表（带分页）
     *
     * @param param
     * @param pageNum
     * @param pageSize
     * @return
     */
    ResponseResult<Paged<GroupVo>> getGroupList(Map<String, Object> param, int pageNum, int pageSize);

    /**
     * 进入修改账户页面时获取角色
     *
     * @return
     */
    List<GroupVo> getGroupListInModifyAccountPage() throws Exception;

    ResponseResult<Boolean> createGroup(GroupCreateVo vo);

    ResponseResult<Boolean> modifyGroup(GroupModifyVo vo);

    GroupBindResourceVo getPermissionTree(int groupId);

    /**
     * 创建角色与权限的关联（先删除后添加，如果resourceIds为null则只删除不添加）
     * @return
     */
    public ResponseResult<Boolean> createBatchGroupResource(GroupBindVo vo);
}
